<template>
	<view class="tn-padding-top">
		<view class="tn-padding">
			
		</view>
		<view class="tn-padding-sm canvas-view">
			<tn-button  width="100%" backgroundColor="#79CF67" fontColor="#fff" :loading="loading" @click="getLastData">自动晨检</tn-button>
		</view>
		<view class="tn-padding-sm canvas-view">
			<tn-button  width="100%" backgroundColor="#79CF67" fontColor="#fff" :loading="loading" @click="shoudong">手动添加</tn-button>
		</view>
		<view class="tn-padding-sm canvas-view">
			<tn-button  width="100%" backgroundColor="#79CF67" fontColor="#fff" :loading="loading" @click="gojilu">晨检记录</tn-button>
		</view>
		
		<tn-toast
		  ref="toast"
		></tn-toast>
	</view>
</template>

<script>
	export default {
		name: 'chenjiandengji',
		
		data(){
			return {
				loading: false
			}
		},
		onShow() {
		},
		mounted() {
			
		},
		methods:{
			clear(){},
			shoudong(){
				uni.navigateTo({
					url: '/pagesA/yuanwuduan/chenjianxinxi'
				})
			},
			gojilu(){
				uni.navigateTo({
					url: '/pagesA/yuanwuduan/chenjianjilu'
				})
			},
			getLastData(){
				this.loading = true
				this.request({
					url: '/MCheck/GetLast',
					method: 'get',
				}).then(res => {
					if(res.code == 200){
						uni.navigateTo({
							url: '/pagesA/yuanwuduan/chenjianxinxi?id='+res.data.id+'&name='+res.data.childrenName+'&recordTime='+res.data.recordTime
						})
					}else{
						this.$refs.toast.show({
						  title: '',
						  content: res.message,
						  icon: '',
						  image: '',
						  duration: 1000
						})
					}
					this.loading = false
				}).catch(err => {this.loading = false})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.canvas-view{
		overflow: hidden;
	}
	.border-view{
		border: 1px dotted #dddddd;
		position: relative;
		width: 100%;
		height: 70%;
	}
	.zwp-view{
		width: 100%;
		height: 100%;
	}
	.pl-text{
		position: absolute;
		top: 50%;
		left: 0;
		width: 100%;
		text-align: center;
		color: #dddddd;
	}
	.top-text{
		font-size: 12rpx;
		color: #555555;
	}
</style>